﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using CE.User;
using CE.Global;
using CE.Provider;
using CE.CarInsurance;
using CE.Database;

public partial class Provider_CarInsurance_ViewEtiqaInsurance : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session[CE.Global.General.UserId] == null || Session[CE.Global.General.ProviderCompanyId] == null)
        {
            Response.Redirect("~/Provider/ProviderSecureLogin.aspx");
        }
        if (!IsPostBack)
        {
            LoadEtiqa();
        }
    }
    protected void grvEtiqa_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (grvEtiqa.Rows.Count > 0)
        {
            string strCPRID = grvEtiqa.SelectedDataKey.Values[0].ToString();
            string strCOVID = grvEtiqa.SelectedDataKey.Values[1].ToString();
            Response.Redirect("AddNewEtiqaInsurance.aspx?CPRID=" + strCPRID + "&COVID=" + strCOVID);

        }
    }

    public void LoadEtiqa()
    {
        CarInsuranceDB _carinsurancedb = new CarInsuranceDB();

        grvEtiqa.DataSource = _carinsurancedb.GetCarInsuranceItemList(Convert.ToInt64(Session[CE.Global.General.ProviderCompanyId].ToString()));
        grvEtiqa.DataBind();

    


    }
}
